package com.novax.ex.activity.provider.handler.consumer;

import com.novax.ex.activity.provider.service.InternalTransferOrderBigdataService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

import jakarta.annotation.Resource;

/**
 * @Description
 * @Author zhaolei
 * @Date 10/24/24 2:59 PM
 * @Version 1.0
 */
@Component
@Slf4j
public class InternalTransferOrderBigdataConsumer {
    @Resource
    private InternalTransferOrderBigdataService internalTransferOrderBigdataService;

    @KafkaListener(id = "internal_transfer_order", groupId = "internal_transfer_order_beeb",
            topics = "internal_transfer_order", idIsGroup = false)
    public void exec(String message) {
        try {
            if (StringUtils.isNotBlank(message)){
                internalTransferOrderBigdataService.execBigData(message);
            }
        } catch (Exception e) {
            log.info(e.toString());
            log.info("消息队列丢失消息:" + message);
        }
    }
}
